FROM alpine:latest
MAINTAINER 王斌 <253498229@qq.com>
ENV TZ=Asia/Shanghai
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
    && apk add tzdata \
    && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
    && echo $TZ > /etc/timezone

RUN apk add openjdk11-jre nginx supervisor && rm -f /var/cache/apk/*
RUN mkdir /run/nginx
WORKDIR /app

ADD config/nginx.conf /etc/nginx/nginx.conf
ADD config/supervisor.conf conf/supervisord.conf

VOLUME ["/app/data"]
VOLUME ["/app/conf"]
VOLUME ["/app/log"]

COPY dist /app/dist
COPY app.jar /app/data/app.jar

CMD ["supervisord", "-n", "-c", "/app/conf/supervisord.conf"]
